#ifndef _KEY_H_
#define _KEY_H_

#include <stdint.h>
#include "gpio.h"
#include <stdbool.h>

#define KEY1_Read()  HAL_GPIO_ReadPin(KEY1_GPIO_Port, KEY1_Pin)
#define Click 1

typedef struct
{
    int16_t KEY_Time;
    uint8_t KEY_count;//按下次数
    uint8_t KEY_Press_Flag;
    int16_t KEY_LONG_Press;
    uint8_t KEY_State;//按键状态，单击，双击，长按
    bool KEY_Count_ENABLE;//1S定时使能
}MyKeyTypeDef;
extern MyKeyTypeDef* MyKey;

void Key_Init(MyKeyTypeDef* MyKey);
void Key_Scan(MyKeyTypeDef* MyKey);
void Key_State_Judge(MyKeyTypeDef* MyKey);

#endif